<?php

namespace Api\Controller;

/**
 * @apiDefine ApiErrorExample
 *
 * @apiErrorExample 失败返回
 * HTTP/1.1 200 OK
 * {
 *  "code": "",
 *  "info": "",
 *  "data": "",
 * }
 *
 */

/**
 * @apiDefine ApiSuccessExample
 *
 * @apiSuccessExample 成功返回
 * HTTP/1.1 200 OK
 * {
 *  "data": "",
 *  "info": "",
 *  "code": 200,
 * }
 * 
 */

/** 
 * 公开反馈接口
 * @author Legend. <xcx_legender@qq.com>
 * @param 
 * @return 
 */

class FeedbackController extends JsonPostBaseController 
{

    /**
     * @api {get}  /api/Feedback/uninstallpc 卸载PC工具的反馈
     * @apiVersion 4.0.0
     * @apiName uninstallpc
     * @apiGroup Feedback
     *
     * @apiParam {String} qq QQ号
     * @apiParam {String} phone 电话
     * @apiParam {List}  reasons 预设的原因选择项目
     * @apiParam {String}  others  其他的原因
     *
     * @apiSuccess {String} info  show message
     * @apiSuccess {Number} code  status code.
     * @apiSuccess {Object} data  extend datas.
     *
     * @apiUse ApiSuccessExample
     *
     * @apiUse ApiErrorExample
     */
    public function uninstallpc()
    {
        $hasMesage = false;
        if ($this->requests){
            foreach ($this->requests as $value) {
                if (!empty($value)){
                    $hasMesage = true;
                }
            }
        }

        $hasMesage or $this->param_error();
        event('FeedbackTool')->addUninstall($this->requests);
        $this->success();
    }


}